# -*- coding: utf-8 -*-
#
# File: copias.py
#
# Copyright (c) 2007 by CTEC
# Generator: ArchGenXML Version 1.5.0
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#

__author__ = """CTEC <joaojoao@gmail.com>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from Products.ibictn.content.formulario import formulario
from Products.Archetypes.SQLStorage import *
from Products.ibictn.config import *

# additional imports from tagged value 'import'
import DateTime

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    StringField(
        name='documento',
        widget=StringWidget(
            label="Identificação do documento",
            description="identifique o documento que será copiado",
            label_msgid='ibictn_label_documento',
            description_msgid='ibictn_help_documento',
            i18n_domain='ibictn',
        )
    ),

    IntegerField(
        name='numero_originais',
        widget=IntegerWidget(
            label="Numeros originais",
            description="",
            label_msgid='ibictn_label_numero_originais',
            description_msgid='ibictn_help_numero_originais',
            i18n_domain='ibictn',
        )
    ),

    IntegerField(
        name='numero_copias',
        widget=IntegerWidget(
            label="Numeros cópias p. originais",
            description="",
            label_msgid='ibictn_label_numero_copias',
            description_msgid='ibictn_help_numero_copias',
            i18n_domain='ibictn',
        )
    ),

    StringField(
        name='total',
        widget=StringWidget(
            label="Total",
            description="",
            label_msgid='ibictn_label_total',
            description_msgid='ibictn_help_total',
            i18n_domain='ibictn',
        )
    ),

    TextField(
        name='instrucoes',
        widget=TextAreaWidget(
            label="Instruções especiais",
            description="",
            label_msgid='ibictn_label_instrucoes',
            description_msgid='ibictn_help_instrucoes',
            i18n_domain='ibictn',
        )
    ),

    DateTimeField(
        name='data_execucao',
        widget=CalendarWidget(
            label="Data da execução do serviço",
            description="deve ser preenchido pelo provedor do serviço",
            label_msgid='ibictn_label_data_execucao',
            description_msgid='ibictn_help_data_execucao',
            i18n_domain='ibictn',
        ),
        read_permission="ibictn: Ler campo",
        write_permission="ibictn: Escrever campo"
    ),

    StringField(
        name='responsavel',
        widget=StringWidget(
            label="Responsável ou operador",
            description="deve ser preenchido pelo provedor do serviço",
            label_msgid='ibictn_label_responsavel',
            description_msgid='ibictn_help_responsavel',
            i18n_domain='ibictn',
        ),
        read_permission="ibictn: Ler campo",
        write_permission="ibictn: Escrever campo"
    ),

),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

copias_schema = BaseSchema.copy() + \
    getattr(formulario, 'schema', Schema(())).copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class copias(formulario, BaseContent):
    """
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(formulario,'__implements__',()),) + (getattr(BaseContent,'__implements__',()),)

    # This name appears in the 'add' box
    archetype_name = 'Solicitação de Cópias'

    meta_type = 'copias'
    portal_type = 'copias'
    allowed_content_types = [] + list(getattr(formulario, 'allowed_content_types', []))
    filter_content_types = 0
    global_allow = 1
    #content_icon = 'copias.gif'
    immediate_view = 'base_view'
    default_view = 'base_view'
    suppl_views = ()
    typeDescription = "Solicitação de Cópias"
    typeDescMsgId = 'description_edit_copias'
    allow_discussion = 1

    _at_rename_after_creation = True

    schema = copias_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods


registerType(copias, PROJECTNAME)
# end of class copias

##code-section module-footer #fill in your manual code here
##/code-section module-footer



